<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />

		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />

		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />

		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>

		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('#btn-export').click(function(){
				if(confirm('ダウンロードしますか？')){
					document.fm.csv.value="download";
					document.fm.submit();
				}
			});
			$('#btn-reset').click(function(){
				location.href = document.fm.action;
			});
			$('#btn_search').click(function(){
				document.fm.csv.value="";
				document.fm.submit();
			});
			/*
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			$('#year4').change(function(){
				var year4 = this.value;
				var myDate = new Date();
				var nowtime =  myDate.getTime();
				$.get("mmap_week_ajax.php",{ y: year4,t : nowtime }, function(data){
					$("#week_cd").children().remove();
					$("#week_cd").append( data );
				});
			});
			*/
			$('.sort').change(function(){
				if (this.value == 2) {
					$('#tr_op3')['hide']();
					$('#tr_op2')['show']();
				}else if (this.value == 3) {
					$('#tr_op2')['hide']();
					$('#tr_op3')['show']();
				}else {
					$('#tr_op2')['hide']();
					$('#tr_op3')['hide']();
				}
			});
			

		});
		/*
		function chkWeek() {
			var weekid = $("#week_cd").val() ;
			if (weekid.length == 0){
				alert("週を選択してください");
				return false;
			 }
			return true;
		}
		*/
		function toPage(thepage) {
			document.fm.page.value =  thepage;
			document.fm.csv.value="";
			document.fm.submit();
		}
		/*
		function setSS( valcd, valnm ) {
			if (gPara == "shop") {
				document.fm.shop_cd.value = valcd;
				document.fm.shop_name.value = valnm;
			}
			if (gPara == "mediaid") {
				document.fm.media_cd.value = valcd;
				document.fm.media_name.value = valnm;
			}
			$('#dialog').dialog("close");
		}
		*/
		</script>
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
	</head>
	<body id="">
{{$menu}}
{{$logout}}
		<div id="container"><div class="wrapper">
			<h2>経費出力一覧</h2>
			<ul class="submenu clearfix">
				<li><a href="mcost_list_index.php">経費・予実比一覧</a></li>
				<li>月別集計</li>
				<li><a href=mcost_list_sum_index.php>累計一覧</a></li>
				<li><a href="mcost_list_quantity_index.php">経準高管理</a></li>
				<li><a href="mcost_list_quantity_import.php">経準高計画一括登録</a></li>
			</ul>
			<h3>月別集計</h3>
			<form name="fm" id="fm" method="get" action="mcost_list_month_index.php" >
				<input type="hidden" name="page" />
				<table class="formTable">
					<tbody>
						<tr>
							<th>※年度</th>
							<td>
								&nbsp;{{ html_options id='year4' name='year4' options=$year4 selected=$forms.year4 style="width:150px;"}} {{ $err.year4 }}
							</td>
						</tr><tr>
							<th>AJA</th>
							<td>
							<table ><tr><td style="border:none">{{ html_radios  name='sort' class="sort" options=$sorts selected=$forms.sort separator='&nbsp;' }} &nbsp;</td>
							<td style="border:none">
<span id="tr_op2"  style="display:{{if ($forms.sort == 2) }}block{{ else }}none{{ /if}};">
{{ html_options name='area_aja' options=$areauser selected=$forms.area_aja }}{{ $err.area_aja }}</span>
<span id="tr_op3"  style="display:{{if ($forms.sort == 3) }}block{{ else }}none{{ /if}};">
{{ html_options id='zone_aja' name='zone_aja'  options=$zoneuser selected=$forms.zone_aja }}{{ $err.zone_aja }}</span>
</td></tr>
</table>
</td>
						</tr>

					</tbody>
				</table>
				<p class="button" style="text-align:right">
					<button type="button" id="btn-reset"><span>クリア</span></button>
					<button type="button" id="btn_search" class="submit"><span>絞込検索</span></button>
				</p>
				<input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
			</form>
{{ if is_numeric($page.cnt) }}
	{{ if $page.cnt > 0 }}
				<p class="message">{{ $page.cnt }}件の情報が見つかりました。</p>
				<p align="left">{{$pageing}}</p>
				
	<div style ="overFlow-x:auto;overFlow-y:hidden;width:100%">
	<table id="search_result"  class="sortable" style = "width:2500px"  >
					<thead><tr>
	<th><h3>年度</h3></th>
	<th><h3>月度</h3></th>

	<th><h3>経準高<br>本年</h3></th>
	<th><h3>経準高<br>計画</h3></th>
	<th><h3>経準高<br>前年</h3></th>
	<th><h3>経準高<br>計画比</h3></th>
	<th><h3>経準高<br>計画差異</h3></th>
	<th><h3>経準高<br>前年比</h3></th>
	<th><h3>経準高<br>前年差異</h3></th>
	
	<th><h3>経費<br>本年</h3></th>
	<th><h3>経費<br>計画</h3></th>
	<th><h3>経費<br>前年</h3></th>
	<th><h3>経費<br>計画比</h3></th>
	<th><h3>経費<br>計画差異</h3></th>
	<th><h3>経費<br>前年比</h3></th>
	<th><h3>経費<br>前年差異</h3></th>

	<th><h3>利益<br>本年</h3></th>
	<th><h3>利益<br>計画</h3></th>
	<th><h3>利益<br>前年</h3></th>
	<th><h3>利益<br>計画比</h3></th>
	<th><h3>利益<br>計画差異</h3></th>
	<th><h3>利益<br>前年比</h3></th>
	<th><h3>利益<br>前年差異</h3></th>
</tr>
					</thead>
					<tbody>
	{{ $nowindex =0 }}
	{{ foreach from=$data key=k item=v name="member" }}
					<tr class="{{cycle values=odd,mod name='member'}}">
					<td>{{ $forms.year4 }}</td>
					<td>{{ $v.month }}</td>
					
					<td align=right>{{ $v.now_qua|number_format:2 }}</td>
					<td align=right>{{ $v.plane_qua|number_format:2 }}</td>
					<td align=right>{{ $v.last_qua|number_format:2 }}</td>
					<td align=right>{{ $v.plane_rate_qua|number_format:2 }}%</td>
					<td align=right>{{ $v.plane_inc_qua|number_format:2 }}</td>
					<td align=right>{{ $v.last_rate_qua|number_format:2 }}%</td>
					<td align=right>{{ $v.last_inc_qua|number_format:2 }}</td>
					
					<td align=right>{{ $v.now_cost|number_format:2 }}</td>
					<td align=right>{{ $v.plane_cost|number_format:2 }}</td>
					<td align=right>{{ $v.last_cost|number_format:2 }}</td>
					<td align=right>{{ $v.plane_rate_cost|number_format:2 }}%</td>
					<td align=right>{{ $v.plane_inc_cost|number_format:2 }}</td>
					<td align=right>{{ $v.last_rate_cost|number_format:2 }}%</td>
					<td align=right>{{ $v.last_inc_cost|number_format:2 }}</td>
					
					<td align=right>{{ $v.now_li|number_format:2 }}</td>
					<td align=right>{{ $v.plane_li|number_format:2 }}</td>
					<td align=right>{{ $v.last_li|number_format:2 }}</td>
					<td align=right>{{ $v.plane_rate_li|number_format:2 }}%</td>
					<td align=right>{{ $v.plane_inc_li|number_format:2 }}</td>
					<td align=right>{{ $v.last_rate_li|number_format:2 }}%</td>
					<td align=right>{{ $v.last_inc_li|number_format:2 }}</td>
					</tr>
	{{ /foreach }}
					</tbody>
				</table>
</div>
				<p align="right">{{$pageing}}</p>

					<p class="button">
						<button type="button" id="btn-export"  ><span>CSVダウンロード</span></button>
					</p>

	{{ else }}
	<p class="message">条件にマッチする情報は見つかりませんでした。</p>
	{{ /if }}
{{ else }}
	<p class="message">ここに検索結果が表示されます。</p>
{{ /if }}
<div id="dialog" >
</div>
		</div></div>
		{{ $footer }}
	</body>
</html>